Skip to content

fix: warn user when filament serial input sanitizes to empty string#10879

Open
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:upstream/fix/serial-validation
Open

fix: warn user when filament serial input sanitizes to empty string#10879
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:upstream/fix/serial-validation

Conversation

@BenJule

@BenJule BenJule commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Show a warning message when the user enters a filament serial number that gets sanitized (trimmed/filtered) to an empty string, preventing silent data loss

Changes

  • src/slic3r/GUI/CreatePresetsDialog.cpp: Add validation that warns the user when serial input becomes empty after sanitization

Test plan

  • Enter a filament serial number consisting only of whitespace or invalid characters
  • Verify a warning is shown instead of silently saving an empty serial
  • Verify normal serial numbers still save correctly

@BenJule BenJule closed this Jun 7, 2026
@BenJule BenJule deleted the upstream/fix/serial-validation branch June 7, 2026 10:09
@BenJule BenJule restored the upstream/fix/serial-validation branch June 7, 2026 11:36
@BenJule BenJule reopened this Jun 7, 2026
@BenJule

BenJule commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Apologies — this PR was closed by mistake on 2026-06-07, and that was an error on my side, not a deliberate decision to withdraw the change.

It happened as an unintended side effect of a branch cleanup in my fork: deleting the head branch automatically closed this PR. The contribution still stands. I have restored the branch and reopened the PR. Sorry for the noise and any confusion this caused.

@tonghao-bbl tonghao-bbl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BenJule Can you have a look at these small issues in the comment?

}
boost::algorithm::trim(vendor_name);
boost::algorithm::trim(serial_name);
if (!serial_str.IsEmpty() && serial_name.empty()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • !serial_str.IsEmpty() is not needed here, check line 1022
  • or leave it blank. in the message dilaog is not OK here since we dont accpet empty string as checked above

@tonghao-bbl tonghao-bbl added the Waiting response Waiting more information from user label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Waiting response Waiting more information from user

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants